package cn.frh.feign.hystrix;

import cn.frh.domain.Store;
import cn.frh.feign.StoreService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
import util.JsonResult;

@Component
public class StoreServiceFallbackFactory implements FallbackFactory<StoreService> {
    @Override
    public StoreService create(Throwable throwable) {
        return new StoreService() {
            @Override
            public JsonResult add(Store store) {
                return JsonResult.me().setSuccess(false).setMsg("正在殴打程序员");
            }
        };
    }
}
